<?php

namespace App\Http\Requests;

use App\Http\Constants\ApplicationStatusConstants;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class CoinsCodingOnoffRequest extends FormRequest
{
    use CommonRequest;
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'status' => [
                'required',
                Rule::in(array_column(ApplicationStatusConstants::STATUS,'value')),
            ],
        ];
        $rules = array_merge($rules, CoinsCodingRequest::baseRules());
        return $rules;
    }

    public function messages()
    {
        $messages = [
            'status.required' =>'状态必选',
            'status.in' =>'状态值只能为0或者1',
        ];
        $messages = array_merge($messages, CoinsCodingRequest::baseMessage());
        return $messages;
    }
}
